<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QLinearGradient Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QLinearGradient Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QLinearGradient class is used in combination with <a href="qbrush.html">QBrush</a> to specify a linear gradient brush.
<a href="#details">More...</a></p>

<p>Inherits <a href="qgradient.html">QGradient</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qlineargradient.html#QLinearGradient">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlineargradient.html#QLinearGradient-2">__init__</a></b> (<i>self</i>, QPointF&#160;<i>start</i>, QPointF&#160;<i>finalStop</i>)</li><li><div class="fn" /><b><a href="qlineargradient.html#QLinearGradient-3">__init__</a></b> (<i>self</i>, float&#160;<i>xStart</i>, float&#160;<i>yStart</i>, float&#160;<i>xFinalStop</i>, float&#160;<i>yFinalStop</i>)</li><li><div class="fn" /><b><a href="qlineargradient.html#QLinearGradient-4">__init__</a></b> (<i>self</i>, QLinearGradient)</li><li><div class="fn" />QPointF <b><a href="qlineargradient.html#finalStop">finalStop</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlineargradient.html#setFinalStop">setFinalStop</a></b> (<i>self</i>, QPointF&#160;<i>stop</i>)</li><li><div class="fn" /><b><a href="qlineargradient.html#setFinalStop-2">setFinalStop</a></b> (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>)</li><li><div class="fn" /><b><a href="qlineargradient.html#setStart">setStart</a></b> (<i>self</i>, QPointF&#160;<i>start</i>)</li><li><div class="fn" /><b><a href="qlineargradient.html#setStart-2">setStart</a></b> (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>)</li><li><div class="fn" />QPointF <b><a href="qlineargradient.html#start">start</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QLinearGradient class is used in combination with <a href="qbrush.html">QBrush</a> to specify a linear gradient brush.</p>
<p>Linear gradients interpolate colors between start and end
points. Outside these points the gradient is either padded,
reflected or repeated depending on the currently set <a href="qgradient.html#Spread-enum">spread</a> method:</p>
<table class="generic">
<tr class="odd" valign="top">
<td><img src="images/qlineargradient-pad.png" /></td>
<td><img src="images/qlineargradient-reflect.png" /></td>
<td><img src="images/qlineargradient-repeat.png" /></td>
</tr>
<tr class="even" valign="top">
<td><a href="qgradient.html#Spread-enum">PadSpread</a>
(default)</td>
<td><a href="qgradient.html#Spread-enum">ReflectSpread</a></td>
<td><a href="qgradient.html#Spread-enum">RepeatSpread</a></td>
</tr>
</table>
<p>The colors in a gradient is defined using stop points of the
<a href="qgradient.html#QGradientStop-typedef">QGradientStop</a>
type, i.e. a position and a color. Use the <a href="qgradient.html#setColorAt">QGradient.setColorAt</a>() or the
<a href="qgradient.html#setStops">QGradient.setStops</a>()
function to define the stop points. It is the gradient's complete
set of stop points that describes how the gradient area should be
filled. If no stop points have been specified, a gradient of black
at 0 to white at 1 is used.</p>
<p>In addition to the functions inherited from <a href="qgradient.html">QGradient</a>, the QLinearGradient class provides
the <a href="qlineargradient.html#finalStop">finalStop</a>()
function which returns the final stop point of the gradient, and
the <a href="qlineargradient.html#start">start</a>() function
returning the start point of the gradient.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QLinearGradient" />QLinearGradient.__init__ (<i>self</i>)</h3><p>Constructs a default linear gradient with interpolation area
between (0, 0) and (1, 1).</p>
<p><b>See also</b> <a href="qgradient.html#setColorAt">QGradient.setColorAt</a>(), <a href="qlineargradient.html#setStart">setStart</a>(), and <a href="qlineargradient.html#setFinalStop">setFinalStop</a>().</p>


<h3 class="fn"><a name="QLinearGradient-2" />QLinearGradient.__init__ (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>start</i>, <a href="qpointf.html">QPointF</a>&#160;<i>finalStop</i>)</h3><p>Constructs a linear gradient with interpolation area between the
given <i>start</i> point and <i>finalStop</i>.</p>
<p><b>Note:</b> The expected parameter values are in pixels.</p>
<p><b>See also</b> <a href="qgradient.html#setColorAt">QGradient.setColorAt</a>() and
<a href="qgradient.html#setStops">QGradient.setStops</a>().</p>


<h3 class="fn"><a name="QLinearGradient-3" />QLinearGradient.__init__ (<i>self</i>, float&#160;<i>xStart</i>, float&#160;<i>yStart</i>, float&#160;<i>xFinalStop</i>, float&#160;<i>yFinalStop</i>)</h3><p>Constructs a linear gradient with interpolation area between
(<i>x1</i>, <i>y1</i>) and (<i>x2</i>, <i>y2</i>).</p>
<p><b>Note:</b> The expected parameter values are in pixels.</p>
<p><b>See also</b> <a href="qgradient.html#setColorAt">QGradient.setColorAt</a>() and
<a href="qgradient.html#setStops">QGradient.setStops</a>().</p>


<h3 class="fn"><a name="QLinearGradient-4" />QLinearGradient.__init__ (<i>self</i>, <a href="qlineargradient.html">QLinearGradient</a>)</h3><h3 class="fn"><a name="finalStop" /><a href="qpointf.html">QPointF</a> QLinearGradient.finalStop (<i>self</i>)</h3><p>Returns the final stop point of this linear gradient in logical
coordinates.</p>
<p><b>See also</b> <a href="qlineargradient.html#setFinalStop">setFinalStop</a>() and <a href="qgradient.html#stops">QGradient.stops</a>().</p>


<h3 class="fn"><a name="setFinalStop" />QLinearGradient.setFinalStop (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>stop</i>)</h3><p>Sets the final stop point of this linear gradient in logical
coordinates to <i>stop</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qlineargradient.html#finalStop">finalStop</a>().</p>


<h3 class="fn"><a name="setFinalStop-2" />QLinearGradient.setFinalStop (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>)</h3><p>This is an overloaded function.</p>
<p>Sets the final stop point of this linear gradient in logical
coordinates to <i>x</i>, <i>y</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qlineargradient.html#start">start</a>().</p>


<h3 class="fn"><a name="setStart" />QLinearGradient.setStart (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>start</i>)</h3><p>Sets the start point of this linear gradient in logical
coordinates to <i>start</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qlineargradient.html#start">start</a>().</p>


<h3 class="fn"><a name="setStart-2" />QLinearGradient.setStart (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>)</h3><p>This is an overloaded function.</p>
<p>Sets the start point of this linear gradient in logical
coordinates to <i>x</i>, <i>y</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qlineargradient.html#start">start</a>().</p>


<h3 class="fn"><a name="start" /><a href="qpointf.html">QPointF</a> QLinearGradient.start (<i>self</i>)</h3><p>Returns the start point of this linear gradient in logical
coordinates.</p>
<p><b>See also</b> <a href="qlineargradient.html#setStart">setStart</a>() and <a href="qgradient.html#stops">QGradient.stops</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>